class Routes {
    constructor() {
        this.login = {}
        this.userLogin = {}
        this.notLogin = {}
        this.errMap = {} //用于错误提示
    }

    setNotLogin(routeName, func, err) {
        this.notLogin[routeName] = func

        if (err) {
            this.errMap[routeName] = err
        }
    }

    setLogin(routeName, func, err) {
        this.login[routeName] = func

        if (err) {
            this.errMap[routeName] = err
        }
    }

    setUserLogin(routeName, func, err) {
        this.userLogin[routeName] = func

        if (err) {
            this.errMap[routeName] = err
        }
    }
}

let routes = new Routes();
module.exports = routes;